package base.test;

import org.junit.Test;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ComponentTransAddr {

    static void s_changeMap(Map<String, String> map) {
        map.remove("key1");
        map.put("s", "static");
    }

    static void s_changeList(List<String> list) {
        list.remove("1");
        list.add("static");
    }

    @Test
    public void text() {
        Map<String, String> map = new HashMap<>();
        List<String> list = new ArrayList<>();

        map.put("key1", "value1");
        map.put("key2", "value2");

        list.add("1");
        list.add("2");
        s_changeMap(map);
        s_changeList(list);


        changeMap(map);
        changeList(list);

        System.out.println(map);
        System.out.println(list);

    }

    void changeMap(Map<String, String> map) {
        map.remove("key1");
        map.put("key3", "value3");
    }

    void changeList(List<String> list) {
        list.remove("1");
        list.add("3");
    }

}
